<template>
  <div class="message">
    <div v-show="props.flag" class="alert">
      <p>{{ props.title }}</p>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  flag: {
    type: Boolean,
    default: false
  },
  title: {
    type: String
  },
});
</script>

<style lang="scss" scoped>
.message {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1002;

  img {
    width: 50px;
    height: 50px;
  }

  .alert {
    width: 40%;
    // height: 30px;
    position: absolute;
    border-radius: 5px;
    font-size: 14px;
    top: 0;
    margin-top: 90%;
    margin-left: 30%;
    left: 0;
    line-height: 30px;
    background-color: rgba(0, 0, 0, 0.5);
    text-align: center;
    color: #fff;
  }
}
</style>